<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition template="template.xhtml" xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ice="http://www.icesoft.com/icefaces/component"
                xmlns:odr="http://www.decisionrepository.com/taglib">

    <ui:define name="head">
    </ui:define>

    <ui:define name="pagetitle">
        <ice:outputText value="#{form['registration.page.title']}" nospan="true" />
    </ui:define>

    <ui:define name="belowHeader">
        <div id="result">
            <ice:outputText value="#{registerUserController.resultMessage}"
                            styleClass="#{registerUserController.resultStyle}"
                            effect="#{registerUserController.resultEffect}"
                            visible="false" />
        </div>
    </ui:define>

    <ui:define name="content">
        <ice:form id="registerForm" partialSubmit="true">

            <h1><h:outputText value="#{form['registration.heading']}"/></h1>







            <div class="formSection">
                <ice:outputLabel value="#{form['label.name']}" for="inName"/>
                <ice:outputText value="#{form['constraint.required']}" styleClass="required" />
                <ice:inputText id="inName"
                               label="#{form['label.name']}"
                               maxlength="255"
                               value="#{registerUserController.name}"
                               required="true">
                    <f:validateLength minimum="3" maximum="30" />

                    <f:validator validatorId="RegexValidator" />
                    <f:attribute name="inputCharset" value="A-Za-z0-9-_ " />

                    <f:validator validatorId="UserNameValidator" />
                </ice:inputText>
                <p>
                    <ice:outputText value="#{form['constraint.minlength']}" nospan="true" /> 3;
                    <ice:outputText value="#{form['constraint.maxlength']}" nospan="true" /> 30;
                    <ice:outputText value="#{form['constraint.charset']}" nospan="true" /> [A-Za-z0-9-_ ];
                    <ice:outputText value="#{form['constraint.username']}" nospan="true" />
                </p>
            </div>







            <div class="formSection">
                <ice:outputLabel value="#{form['label.password']}" for="inPassword" />
                <ice:outputText value="#{form['constraint.required']}" styleClass="required" />
                <ice:inputSecret id="inPassword"
                                 label="#{form['label.password']}"
                                 maxlength="255"
                                 value="#{registerUserController.password}"
                                 required="true"
                                 redisplay="true">
                    <f:validateLength minimum="5" maximum="255" />
                </ice:inputSecret>
                <p>
                    <ice:outputText value="#{form['constraint.minlength']}" nospan="true" /> 5;
                    <ice:outputText value="#{form['constraint.maxlength']}" nospan="true" /> 255
                </p>
            </div>







            <div class="formSection last">
                <ice:outputLabel value="#{form['label.email']}" for="inEmail"/>
                <ice:outputText value="#{form['constraint.required']}" styleClass="required" />
                <ice:inputText id="inEmail"
                               label="#{form['label.email']}"
                               maxlength="255"
                               value="#{registerUserController.email}"
                               required="true">
                    <f:validateLength maximum="255" />

                    <f:validator validatorId="EmailValidator" />
                </ice:inputText>
                <p>
                    <ice:outputText value="#{form['constraint.maxlength']}" nospan="true" /> 255;
                    <ice:outputText value="#{form['constraint.email']}" nospan="true" />
                </p>
            </div>






            <ice:commandButton action="#{registerUserController.submitForm}"
                               value="#{form['button.submit']}"
                               styleClass="confirm"
                               id="registrationSubmitButton"/>



            <ice:commandButton actionListener="#{registerUserController.resetForm}"
                               value="#{form['button.clear']}"
                               styleClass="abort"
                               id="registrationAbortButton"
                               immediate="true"/>

        </ice:form>
    </ui:define>

    <ui:define name="sidebar">
        <div id="help">
            <ul class="info">
                <li class="messages">
                    <div class="header"></div>
                    <div class="text">
                        <ice:messages layout="list" 
                                      errorClass="error"
                                      warnClass="warning"
                                      fatalClass="fatal"
                                      infoClass="information" />
                    </div>
                </li>
                <li>
                    <div class="header">
                        <img src="resources/images/info.png" alt="information" />
                    </div>
                    <div class="text">
                        <h2>dsadas</h2>
                        content?
                    </div>
                </li>
            </ul>
        </div>
    </ui:define>
</ui:composition>